<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

$config = [
    'id' => 'app-frontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'frontend\controllers',
    'components' => [
      'request' => [
			'baseUrl' => '',
		],
		'session' => [
			'name' => 'PHPFRONTSESSID',
			'savePath' => __DIR__ . '/../tmp',
		],
		  // 'user' => [
            // 'identityClass' => 'common\models\User',
				// 'enableAutoLogin' => true,
        // ],

        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
		'urlManager' => [
			'baseUrl' => '/',
			'enablePrettyUrl' => true,
			'showScriptName' => false,
			'rules' => [
			    '<controller:(kho)>/<action:(update|view)>/<id:\d+>' => '<controller>/<action>'
			],
		]
    ],
    'params' => $params,
];

if (!YII_ENV_TEST) {
	// die("12131");
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';
    $config['bootstrap'][] = 'gii';
   $config['modules']['gii'] = [
		'class' => 'yii\gii\Module',
		'allowedIPs' => ['127.0.0.1', '::1', '10.43.66.*', '192.168.178.20'],
	];
}
// echo '<pre>';
// print_r($config);die;
return $config;
